package com.cool.reggie.utils;

/**
 * 将Long泛型修改为自定义的User对象，可以缓存整个User信息
 *
 * @Author ifredomvip@gmail.com
 * @Date 2022/7/6 9:08
 * @Version 1.0.0
 * @Description
 **/
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }


    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void remove() {
        threadLocal.remove();
    }


}
